import { Entity, Column, PrimaryGeneratedColumn, ManyToMany } from 'typeorm'

import { Tags } from './tags.entity'
@Entity({ name: 'book' })
export class Book {
    //自增列
    @PrimaryGeneratedColumn()
    id: number
    //普通列
    @Column()
    name: string

    @ManyToMany(() => Tags, tags => tags.books, { cascade: true })
    tags: Tags[]


}